package test1224;

public class Test08 {
    public static void main(String[] args) {
        // 找出arr中最大值的下标
        int[] arr = {6, 1, 7, 4, 3};
        int maxIndex = 0;
        int maxVal = 0;
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] > maxVal) {
                maxVal = arr[i];
                maxIndex = i;

            }
        }
        System.out.println(maxIndex);
    }
}
